package com.minshenglife.zanzan.dao;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.minshenglife.commons.dal.EntityDao;
import com.minshenglife.commons.dal.MyBatisRepository;
import com.minshenglife.zanzan.entity.ComplainCount;
import com.minshenglife.zanzan.entity.Dept;
import com.minshenglife.zanzan.entity.DeptCount;
import com.minshenglife.zanzan.entity.ManagerMail;
import com.minshenglife.zanzan.entity.ReviewCount;
import com.minshenglife.zanzan.entity.User;
import com.minshenglife.zanzan.entity.UserLog;
import com.minshenglife.zanzan.entity.WorkLogCount;
import com.minshenglife.zanzan.entity.WorkLogCountWeek;
import com.minshenglife.zanzan.result.EmpWorkCon;
import com.minshenglife.zanzan.result.ManagerResult;

/**
 * @author Hao HaiLin
 *
 */
/**
 * @author Hao HaiLin
 *
 */
@Repository
@MyBatisRepository
public interface ManagerDao extends EntityDao<User>{
	
	/**
	 * 根据名次、部门、开始日期和结束日期查找用户信息
	 * @param order
	 * @param dept
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	
	public List<User> findByConditons(Map<String,Object> map);
	
	/**
	 * 根据查询条件统计符合条件的记录总数
	 * @param map
	 * @return
	 */
	public Long countByConditions(Map<String,Object> map);
	/**
	 * 按部门统计红花总数、送花总数、积分总数
	 * @param map
	 * @return
	 */
	public List<DeptCount> countByDept(Map<String,Object> map);	
	
	/**
	 * 根据条件统计符合条件的日志记录数
	 * @param map
	 * @return
	 */
	public Long countLogByConditions(Map<String,Object> map);
	
	/**
	 * 根据条件查找符合的记录
	 * @param map
	 * @return
	 */
	public List<UserLog> findLogByConditons(Map<String,Object> map);
	/**
	 * 查询公司所有机构部门
	 * @return
	 */
	public List<Dept> findAllDept();
	/**
	 * 按条件查询结果来导出excel
	 * @param map
	 * @return
	 */
	public List<User> findForExcel(Map<String,Object> map);
	public Long countRedByConditions(Map<String,Object> map);
	public List<User> findRedByConditons(Map<String,Object> map);
	public List<User> findRedForExcel(Map<String,Object> map);
	public Long countSendByConditions(Map<String,Object> map);
	public List<User> findSendByConditons(Map<String,Object> map);
	public List<User> findSendForExcel(Map<String,Object> map);
	public Long countIntegralByConditions(Map<String,Object> map);
	public List<User> findIntegralByConditons(Map<String,Object> map);
	public List<User> findIntegralForExcel(Map<String,Object> map);
	public Long countFlowerProgressBank( Map<String,Object> map);
	public List<ManagerResult> findFlowerProgressBank(Map<String,Object> map);
	public List<ManagerResult> findProgressForExcel(Map<String,Object> map);
	public Long countMailByConditions( Map<String,Object> map);
	public List<ManagerMail> findMailByConditons(Map<String,Object> map);
	public ManagerMail findMailContent(Map<String,Object> map);
	public Long countReviewConditions( Map<String,Object> map);
	public List<ReviewCount> findReviewByConditons(Map<String,Object> map);
	public Long countComplainConditions( Map<String,Object> map);
	public List<ComplainCount> findComplainByConditons(Map<String,Object> map);
	public Long countWorkLogByConditions( Map<String,Object> map);		
	public List<WorkLogCount> findWorkLogByConditons(Map<String,Object> map);	
	public List<WorkLogCount> findWorkLogForExcel(Map<String,Object> map);
	public Long countDeptSumByConditions(Map<String,Object> map);
	public List<User> findDeptSumByConditons(Map<String,Object> map);
	public Long countDeptSendSumByConditions(Map<String,Object> map);
	public List<User> findDeptSendSumByConditons(Map<String,Object> map);
	public List<User> findDeptRedForExcel(Map<String,Object> map);
	public List<User> findDeptSendForExcel(Map<String,Object> map);
	public List<WorkLogCount> findSHYWorkLogByLogDateForExcel(Map<String,Object> map);	
	public Long countWorkLogByConditionsBySHY( Map<String,Object> map);
	
	public List<WorkLogCount> findBWorkLogByConditonsForExcel(Map<String,Object> map);
	public List<WorkLogCount> findBWorkLogByConditons(Map<String,Object> map);
	public Long countBWorkLogByConditions( Map<String,Object> map);	
	
	public Long countBWorkLogWeekByConditions( Map<String,Object> map);
	public List<WorkLogCountWeek> findBWeekWorkCountByConditons(Map<String,Object> map);
	public List<WorkLogCountWeek> findBWeekWorkCountByConditonsForExcel( Map<String,Object> map);
	
	public Long countBWorkLogWeekByConditionsNoSoft( Map<String,Object> map);
	public List<WorkLogCountWeek> findBWeekWorkCountByConditonsNoSoft(Map<String,Object> map);
	public List<WorkLogCountWeek> findBWeekWorkCountByConditonsForExcelNoSoft( Map<String,Object> map);
	
	public List<EmpWorkCon> selectWorkConAndReviews(Map<String,Object> map);
}
